x86/mm/hap: Adjust vram tracking to play nicely with log-dirty.
authorRobert Phillips <robert.phillips@citrix.com>
Thu, 13 Dec 2012 12:10:14 +0000 (12:10 +0000)
committerRobert Phillips <robert.phillips@citrix.com>
Thu, 13 Dec 2012 12:10:14 +0000 (12:10 +0000)
commitfd91a2a662bc59677e0f217423a7a155d5465886
tree72a8aa72a4460d9c8a17593315cc18c9da043390
parenta31ed4edbe48c8f24b4a7f1f41c7cc9d7453721e
x86/mm/hap: Adjust vram tracking to play nicely with log-dirty.

The previous code assumed the guest would be in one of three mutually exclusive
modes for bookkeeping dirty pages: (1) shadow, (2) hap utilizing the log dirty
bitmap to support functionality such as live migrate, (3) hap utilizing the
log dirty bitmap to track dirty vram pages.
Races arose when a guest attempted to track dirty vram while performing live
migrate.  (The dispatch table managed by paging_log_dirty_init() might change
in the middle of a log dirty or a vram tracking function.)

This change allows hap log dirty and hap vram tracking to be concurrent.
Vram tracking no longer uses the log dirty bitmap.  Instead it detects
dirty vram pages by examining their p2m type.  The log dirty bitmap is only
used by the log dirty code.  Because the two operations use different
mechanisms, they are no longer mutually exclusive.

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Minor whitespace changes to conform with coding style
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/mm/paging.c
xen/include/asm-x86/config.h
xen/include/asm-x86/paging.h